import request from "./http";

// 登录
export type LoginParamsType = {
  username: string;
  password: string;
};
export const userlogin = (data: LoginParamsType) => {
  return request("/user/login", "POST", data);
};

// 菜单渲染
export type menuType = {
  code: number;
  msg: string;
  data: [];
};

export type DataMenu = {
  id: string;
  menuname: string;
  parentid: number | string;
  component: string;
  icon: string;
  link: string;
  isParent: boolean;
  [property: string]: any;

  children: [
    {
      id: string;
      menuname: string;
      parentid: number | string;
      component: string;
      icon: string;
      link: string;
      isParent: boolean;
    }
  ];
};

export const MenuList = () => {
  return request<DataMenu>("/user/menus", "GET");
};
